home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ETO Development Tools 4
/
ETO Development Tools 4.iso
/
Tools - Objects
/
Virtual User 1.0
/
Example Scripts
/
MessagePassing Example
/
Actor2.vu
< prev
next >
Wrap
Text File
|
1991-01-25
|
2KB
|
52 lines
#
# File: actor2.vu
#
# Contains: This is a demo script which runs in parallel with the script
# Actor2.vu. They together demonstrate message passing while
# sharing tasks in a library. To run this demo you need two
# target machines (both having the Desk Accessory, Key Caps).
# It would be better if the two targets had different memory
# configurations and are running different versions of system software.
# Your command line should be as follows: (assuming the two
# targets have user names as Target1 and Target2 and that
# Actor1.vu, Actor2.vu and the library MessagePassingDemoLib.vu
# are all in your current working directory)
# VU -t1 '*:Target1' -s1 Actor1.vu -l1 Actor1.log ∂
# -t2 '*:Target2' -s2 Actor2.vu -l2 Actor2.log
#
# Caution: Do not forget to turn the key repeat off in the control panel on both
# the targets. The script takes a few seconds before you start seeing
# anything on the target screens.
#
# Written by: P Nagarajan
#
# Copyright: © 1990 by Apple Computer, Inc., all rights reserved.
#
# Change History:
#
# 8/16/90 naga creation
#
# To Do:
#
Libraries "MessagePassingDemoLib.vu";
actorName((match[target]).t); #change actor's name to target's User Name
main_actor := [actor t:'Actor1'];
open_session(main_actor);
msg := receive(main_actor);
while msg = ''
begin
wait(1);#wait is used to avoid tight loops
#in order to share time with other actors
msg := receive(main_actor);
end;
if (msg = 'Start')
begin
run_demo(main_actor);
end;#do demo
closeSession(main_actor);